package com.aidex.system.service.impl;

import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.system.domain.VCsisBusinessUnpacking;
import com.aidex.system.mapper.VCsisBusinessUnpackingMapper;
import com.aidex.system.service.VCsisBusinessUnpackingService;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 国内开箱数据Service业务层处理
 * @author wll
 * @email wll
 * @date 2021-10-14
 */
@Service
@Transactional(readOnly = false)
public class VCsisBusinessUnpackingServiceImpl extends BaseServiceImpl<VCsisBusinessUnpackingMapper, VCsisBusinessUnpacking> implements VCsisBusinessUnpackingService
{
    private static final Logger log = LoggerFactory.getLogger(VCsisBusinessUnpackingServiceImpl.class);

    /**
     * 获取单条数据
     * @param vCsisBusinessUnpacking 国内开箱数据
     * @return 国内开箱数据
     */
    @Override
    public VCsisBusinessUnpacking get(VCsisBusinessUnpacking vCsisBusinessUnpacking)
    {
        VCsisBusinessUnpacking dto = super.get(vCsisBusinessUnpacking);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 国内开箱数据id
     * @return 国内开箱数据
     */
    @Override
    public VCsisBusinessUnpacking get(String id)
    {
        VCsisBusinessUnpacking dto = super.get(id);
        return dto;
    }


    /**
     * 查询国内开箱数据列表
     * @param vCsisBusinessUnpacking 国内开箱数据
     * @return 国内开箱数据
     */
    @Override
    public List<VCsisBusinessUnpacking> findList(VCsisBusinessUnpacking vCsisBusinessUnpacking)
    {
        return super.findList(vCsisBusinessUnpacking);
    }

    /**
     * 分页查询国内开箱数据列表
     * @param vCsisBusinessUnpacking 国内开箱数据
     * @return 国内开箱数据
     */
    @Override
    public PageInfo<VCsisBusinessUnpacking> findPage(VCsisBusinessUnpacking vCsisBusinessUnpacking)
    {
        return super.findPage(vCsisBusinessUnpacking);
    }

    /**
     * 保存国内开箱数据
     * @param vCsisBusinessUnpacking
     * @return 结果
     */
    @Override
    public boolean save(VCsisBusinessUnpacking vCsisBusinessUnpacking)
    {
        return super.save(vCsisBusinessUnpacking);
    }


    /**
     * 删除国内开箱数据信息
     * @param vCsisBusinessUnpacking
     * @return 结果
     */
    @Override
    public boolean remove(VCsisBusinessUnpacking vCsisBusinessUnpacking)
    {
        return super.remove(vCsisBusinessUnpacking);
    }

    /**
     * 批量删除国内开箱数据
     * @param ids 需要删除的国内开箱数据ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteVCsisBusinessUnpackingByIds(String[] ids)
    {
        return mapper.deleteVCsisBusinessUnpackingByIds(ids);
    }

    @Override
    public VCsisBusinessUnpacking getByWaybillNo(String waybillNo) {
        VCsisBusinessUnpacking param = new VCsisBusinessUnpacking();
        param.setMwbno(waybillNo);
        List<VCsisBusinessUnpacking> list = this.findList(param);
        if (list == null || list.isEmpty()) {
            return null;
        }
        return list.get(0);
    }

}
